#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define NMAX 100005
#define MAX 0xffffffff


bool* dec2bin(int x){
 	int i,k=0;
	bool* r=(bool*)malloc(32);
	//memset(r,0,32);
	while (x){
		r[k++]=x%2;
		x/=2;
	}
	for (i=k;i<32;i++) r[i]=0;
	for(i=31;i>=0;i--) printf("%d",r[i]);
	printf("\n");	
	return r;
		
}
int main(){
 	
	dec2bin(32);
	dec2bin(21);
	dec2bin(0xffffffff);
	int x=-1;
	dec2bin(x);
	printf("%0x",x);
	x=x<<31;
	dec2bin(x);
	short int q1=-1;
	int q2=q1;
	printf("%08x\n%08x\n%08x\n%08x\n",-1,0xffffffff,q1,q2);
	unsigned	int t=0xfffffffe;
	printf("%08x=%d\n",t,t);
 	t=t>>1;
	printf("%08x=%d\n",t,t);
 
	 return 0;
} 